package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;
import java.util.UUID;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117688551";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCLc8nrVNli5RMIzQkyOrN1A3dWxOs6t7VtSbEzBNTeUbU4phwQtw/0DsSi6O/pfrvBvpe5EUGT1C7eKEIDFuSREMpOLxKcvUIygKNGn8CLwELT+kIGK+MIckj+uGIirshQA+Hzsp/+xhbrvrEtaBtnmmWtRk69o2U/7oFQ9FvD+KuqxRv+Ntz/mO8uRNjt3uAODo0ymIi19V+ZjWRye/jpnuASPRRTvjdmh2Jkt4HS8gzdP0d6ZB7CwV8O5mUR2w4WXMkBuwDq3VNzuf7aF9D/XoD6UP3DWkyG/bcmlMiQ+6K973w8rCMhcqU1URX8dEWiw5suhGLULRIfHXwjQ4ThAgMBAAECggEAcyKlWqwSU2lofsKyTgtTMVAsTrKEuFUG8PV/3OynR+rUIbJbx50tCcbLqOmDcxfUsxDGOeE6cHAmRfudDOnwyqi/LzAEQO6tYf79T4kEMx4IzvV3X5sKdmXNSKk5NQNzlUSvYEJhgLtSH0+w/xlOTwqV2isLRd1K8i7cC9fEkBZVtT1bW43WWZ7F7xiMgQIOGy1ZTHROv8VInMQmxLlcnZIYBWns2O9CZUxeU3CPbz5fVIgDWyxaJW3cSSKVK1MilpXByX46wgKaNdR6YgYjZcnnOlIcyrsz7ZZcVTZFxz0hKMhQIgg5nJy88/IE5PCePYhYp9vDvV3ebFhXSiD8RQKBgQDwNt/z/ShcuYCfhHM3qMsLRZTe1J0f73ecz/aHUoGTThUc+FgQiGe8gt+i6f4q9X6wkd4GHZiBHXCrR++tbiV+EvkgELWn9/n/pkqGMoziC12t/cUi/U5G6myli7BcPsBe8lstiLzGPLtraJS5caAx1QXXnWLKjSP1gxaAadxNUwKBgQCUnctUokVjWFtV2P769guFzeK5ukZ3+e7vE24citmxfJotMhmAXMsEZNsRqAaSZgbd64neTzQ8MGJC1FqHoyPaDFk51ArR/FbWnPYMjJKMczk4SiokCW7vDeQ6sozTPvAqLR67pq5mi7rWdd8KuKXIJEp3+ch+hS+1tbWUhUJqewKBgBTO3BV5j36AvyiSQ5zFrVj7nQq0Ziv3BWh7B0LvnbPR5rhMtuwvtLS6rX6iQFceTuwippXnCGfe0fy0TYm7adoC8LubVvEG5QwFLp1zUYrfKy1AN0xxns87zU+FyzAia22OFuHZ32hYqG+EbqWltxe5+TiVNJKRKVVCFrfm86NrAoGABG3DXm1Lhg9fAWrrBk2IwF8HT6OWcALZtPQuRtl4bUqaSZiBnAqn3iSnRppsP7aco8ZeIGrZ0qVaeEVdwUcCTYAqtId2HxXW/KRGzM7vmxHf9aZ4JQTG8obGc11Yxv7MJ2Wa0drAvbuSQMvYbrhb8F/sfDDMYcDUUCTvGVLzTLsCgYEA7TN0oLN4J9OPt5g6u0FIaZdKU+RZa5RR6Zya8awYhVjO/giE2kVqXLZZcmsSf4XyPQPJDGI9oM1sUM9a7a+VLPYPSsMr2+i5aCoATTi1cTU+d0dxUz3cGzmErRhEZbH7XYnMA4m0HTrbtGWf+mwqJib5pDbgI7Ay2ahIlMqFia0=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAip+J2MaN3zktc7Als+J2z6OBakQRi/TcJ/83gNPnYLU49KaQRS1VmgI9WRf7W7vCSOt2hhZ/PwPrvvVW5QbEKy2+iOsAmfgnXs6KKFRZvK6FaWFiVd3XaQSXNF9XXYkYsvoth0atnR92MeAEmwlcmsIdTRD8jsGrQGdDi8RcXY/cUkL6TQ/vhKmF6SON5osdf9ULUor6OWsb6xKVkGFJ6s4jBqEJHayyD4KLpos7vmO0rRTgr1msfC/a/4VsnBVEUtFtPQh2JrW1CW6LSU/gZNCnhyNSjzLR2uPSGoloT/1lJ2ByYTr10Pj+MPHPQW+zzHQaA/Vm2AyzaZVzIZrIzQIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=124这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/dangDang-project/front/pay/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关          沙箱环境下需要替换为：                "https://openapi.alipaydev.com/gateway.do"
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
    public static void main(String[] args) {
        System.out.println(UUID.randomUUID().toString());
    }
}


